package com.le.springbootmybatis.service.impl;

import com.le.springbootmybatis.mapper.UserMapper;
import com.le.springbootmybatis.model.User;
import com.le.springbootmybatis.service.UserService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@AllArgsConstructor
public class UserServiceImpl implements UserService {
    private UserMapper userMapper;
    @Override
    public List<User> list() {
        return userMapper.list();
    }

    @Override
    public void delete(int id) {
        userMapper.delete(id);
    }

    @Override
    public void add(User user) {
        userMapper.add(user);
    }

    @Override
    public User selectById(int id) {
      return userMapper.selectById(id);
    }

    @Override
    public void edit(User user) {
        userMapper.edit(user);
    }
}
